/***************************************************************************
 *                                                                         *
 *   This file is part of the CrystalMem project,                          *
 *       http://code.google.com/p/crystalmem                               *
 *                                                                         *
 *   Copyright (C) 2008 by Alberto Scarpa <scarpa.alberto@gmail.com>       *
 *   Copyright (C) 2008 by Enrico Ros <enrico.ros@gmail.com>               *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef __ProgramNode_h__
#define __ProgramNode_h__

#include <QList>
#include "vectormath.h"

class ProgramNode /*: public Moveable, public Renderable*/
{
    public:
        ProgramNode( quint64 retAddr, ProgramNode *parent );
        ~ProgramNode();

        ProgramNode * memoryAdded( QList<quint64> &backTrace, quint32 size );
        void memoryRemoved( quint32 size, ProgramNode *child );
        void print();

        quint64 returnAddress;
        quint64 objAddress;
        quint64 funcAddress;

        quint32 localMem;
        quint32 totalMem;

        quint32 newPassCount;
        quint32 deletePassCount;

        quint32 idleCounter; // 100 when it's traversed, decremented to zero by the phy update

        // physics (temp: enrico) //TODO: init defaults of those
        bool fixed;
        Vector3 pos;
        Vector3 vel;
        Vector3 force;

        ProgramNode *parent;
        QList<ProgramNode*> children;
};

#endif
